package com.zhijiaoyun.service;

import com.zhijiaoyun.model.Course;
import com.zhijiaoyun.model.dto.CourseDto;
import com.zhijiaoyun.model.dto.PageList;

import java.util.List;
import java.util.Map;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface ICourseService {

    Course getCourseByName(String name);

    void addCourse(Course course);

    Course getCourseByNameNotCourseId(Long courseId, String name);

    Course getCourseByCourseId(Long courseId);

    CourseDto getCourseDtoByCourseId(Long courseId);

    void modifyCourse(Course course);

    PageList<Course> pageByParams(Integer pageIndex, String name, String title, Integer status, List<Long> ids);

    PageList<CourseDto> pageByParamsDto(Integer pageIndex, int pageSize, String name, String title, Integer status, List<Long> ids);

    void changeLessonNum(Long courseId);

    List<Course> getCourseByIds(List<Long> ids);

    List<CourseDto> getCourseByCategoryIds(List<Long> parentIds, int pageSize);

    void addSaleNum(Long courseId);

    void addViewNum(Long courseId);

    void deleteCourse(Course course);

    int countAll();

    /**
     * get by id
     *
     * @param courseId
     * @return
     */
    Map<String, Object> getById(long courseId);

    CourseDto getCourseDtoBlobsByCourseId(Long courseId);

    /**
     * 历史学习记录
     * @param pageIndex
     * @param pageSize
     * @param userId
     * @param categorySuper
     * @param name
     * @return
     */
    Map<String, Object> pageCourseHistoryByParams(int pageIndex, int pageSize, long userId, Long categorySuper, String name);

    /**
     * 评论课程
     * @param courseId
     * @param message
     * @param userId
     * @return
     */
    Map<String,Object> comment(long courseId, String message, long userId);

    /**
     * 删除评论
     * @param id
     * @param userId
     * @return
     */
    Map<String,Object> deleteComment(long id, long userId);

    /**
     * 分页查询某个课程的评论
     * @param pageIndex
     * @param pageSize
     * @param courseId
     * @return
     */
    Map<String,Object> listComments(int pageIndex, int pageSize, long courseId);

    Map<String,Object> pageByParamsDto(int pageIndex, int pageSize, String name, String title, Integer status, Long category1, Long category2);
}
